package com.voute.Model.Impl;

import com.voute.Api.FeedDetailService;
import com.voute.Model.Bean.BaseBean;
import com.voute.Model.Bean.FeedDetailBean;
import com.voute.Model.Bean.VoteResultBean;
import com.voute.Model.IFeedDetailModel;
import com.voute.Utils.ServiceFactory;

import java.util.HashMap;

import rx.Observable;


/**
 * Created by liucxu on 2017/1/23.
 */

public class FeedDetailModelImpl implements IFeedDetailModel {

    @Override
    public Observable<FeedDetailBean> getFeedDetails(String fid) {
        return ServiceFactory.GetInstance().createService(FeedDetailService.class).getFeedDetails(fid);
    }

    @Override
    public Observable<BaseBean> starFeeds(String fid) {
        HashMap<String,String> values=new HashMap<>();
        return ServiceFactory.GetInstance().createService(FeedDetailService.class).starFeeds(fid,values);
    }

    @Override
    public Observable<VoteResultBean> voteFeed(String fid, HashMap<String, String> values) {
        return ServiceFactory.GetInstance().createService(FeedDetailService.class).voteFeed(fid,values);
    }

    @Override
    public Observable<BaseBean> unstarFeeds(String fid) {
        return ServiceFactory.GetInstance().createService(FeedDetailService.class).unstarFeeds(fid);
    }

    @Override
    public Observable<BaseBean> upComment(String cid, String uxtag, int side) {
        HashMap<String,String> values=new HashMap<>();
        values.put("uxtag",uxtag);
        values.put("side",side+"");
        return ServiceFactory.GetInstance().createService(FeedDetailService.class).upComment(cid,values);
    }

    @Override
    public Observable<BaseBean> reportFeed(String fid, HashMap<String, String> params) {
        return ServiceFactory.GetInstance().createService(FeedDetailService.class).reportFeed(fid,params);
    }
}
